from django.db import models


# Create your models here.
class Activities(models.Model):
    # 字段一般都默认不为空
    STATUS=(
        (1,"报名中"),
        (2,"未开始报名"),
        (3,"活动结束"),
        (4,"正在活动中")
    )
    title = models.CharField(verbose_name="标题",max_length=32)
    start_time=models.DateTimeField( verbose_name="开始时间")
    end_time=models.DateTimeField(verbose_name="结束时间")
    deadline=models.DateTimeField(verbose_name="报名截止时间")
    detail=models.TextField(verbose_name="详情介绍")
    address=models.CharField(verbose_name="详细地址",max_length=64)
    img_url=models.CharField(verbose_name="图片地址",max_length=64)
    sponsor=models.CharField(verbose_name="主办方",max_length=32)
    desc=models.TextField(verbose_name="简介")
    city=models.CharField(verbose_name="举办城市",max_length=64)
    status=models.SmallIntegerField(choices=STATUS,verbose_name="活动状态",default=1)
    related_url=models.CharField(verbose_name="相关的链接",max_length=64)
    class Meta:
        db_table = "tb_activities"
        verbose_name = "活动"
        verbose_name_plural = verbose_name
